package cn.microservices.cloud.system.service.stream;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.function.StreamBridge;
import org.springframework.stereotype.Component;

import java.util.UUID;

@Component
public class TestKafkaOutImpl implements TestKafkaOut{

    @Autowired
    StreamBridge streamBridge;

    @Override
    public void sendMessage() {
        String message = UUID.randomUUID().toString();
        streamBridge.send("log","测试发送1:"+message);
        streamBridge.send("addAge","测试发送2:"+message);
        System.out.println("消息发送："+message);
    }
}
